<?php
$_module = $sf_request->getParameter('module');
$_action = $sf_request->getParameter('action');
?>
<div id="sidebar">
    <ul>
        <li>
            <h2>Panel de control</h2>
            <?php if($_action == 'index' || $_action == 'filter' ) {?>
            <ul>
                <li>
                    <a href="<?php echo url_for($_module.'/new') ?>"><?php echo('Agregar '.$_module)?></a>
                </li>
            </ul>
            <?php }?>

            <?php if($_action == 'show') {?>
            <ul>
                <li><a href="<?php echo url_for($_module.'/index') ?>">Volver al listado de <?php echo $_module.'s' ?></a></li>
                <li><a href="<?php echo url_for($_module.'/edit?id='.$object->getId()) ?>"><?php echo('Editar '.$_module)?></a></li>
            </ul>
            <?php }?>

            <?php if($_action == 'new') {?>
            <ul>
                <li><a href="<?php echo url_for($_module.'/index') ?>">Volver al listado de <?php echo $_module.'s' ?></a></li>
            </ul>
            <?php }?>

            <?php if($_action == 'edit') {?>
            <ul>
                <li><a href="<?php echo url_for($_module.'/index') ?>">Volver al listado de <?php echo $_module.'s' ?></a></li>
                <li><?php echo link_to('Delete', $_module.'/delete?id='.$object->getId(), array('method' => 'delete', 'confirm' => 'Eliminar '.$_module))?></li>
            </ul>
            <?php }?>
        </li>
    </ul>
</div>